﻿namespace net.zxteam.ZXLexer.Rules.Internal
{
	using net.zxteam.ZXLexer.Tokens;
	using System.Diagnostics.Contracts;

	internal sealed class StringRule : InnerRule, IStringRule
	{
		private readonly string _value;

		internal StringRule(IRule parentRule, string value)
			: base(parentRule)
		{
			_value = value;
		}

		public override IToken Accept(IRuleVisitor visitor)
		{
			Contract.Requires(visitor != null);

			return visitor.VisitStringRule(this);
		}

		public string Value { get { return _value; } }
	}
}
